<template>
  <div>
    <h2>事件修饰符</h2>
    <div class="box" @click="bb">
      <a href="https://www.baidu.com/" @click.prevent.stop="aa">跳转到百度</a>
    </div>

    <!-- 按键修饰符，只能给 keyup、keydown 绑定 -->
    <input type="text" @keyup.enter="cc" />
  </div>
</template>

<script>
export default {
  methods: {
    aa () {
      console.log(123)
    },
    bb () {
      console.log(456)
    },
    cc (e) {
      console.log(e.target.value) // 输出 输入框的值
    }
  }
}
</script>

<style>
.box {
  width: 300px;
  height: 100px;
  background-color: cadetblue;
}
</style>
